import type { UserInfo } from '@/types/user'
import { request } from '@/utils/request'

//密码登录
export const loginPassword = (username: string, password: string) => {
  return request<UserInfo>('/login', 'post', { username, password })
}
export const register = (username: string, password: string) => {
  return request<UserInfo>('/register', 'post', { username, password })
}
export const getUserInfo = () => {
  return request('/getUserInfo')
}
export const changePassword = (oldPassword: string, newPassword: string) => {
  return request('/changePassword', 'post', { oldPassword, newPassword })
}
